<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body>
    <div id='str'>helloworld</div>
    <button onclick='copy()'>点击复制上面的文字</button>
</body>
<script src="js/indexedDB.js"></script>
<script>
    var db = inquiryDB('KF1', 'chat_data', 1);
    console.log(db);

    db.addMsg({name: 'mali', sex: '女', msg_id: 123456}, function (e) {
        setTimeout(function () {
            if (e.readyState == 'done') console.log('成功');
            console.log(e.readyState);
        }, 50);
    });

    // db.getDataAll (function (e) {
    //     console.log(e.data);
    // })

    // db.getDataIndexKey ('msg_id', 123456,function (e) {
    //     console.log(e.data);
    // })

    db.getDataByPager (1, 10, function (e) {
        console.log(e.data);
    })

    // db.delDataAll(function (e) {
    //     setTimeout(function () { 
    //         if (e.readyState == 'done') console.log('成功');
    //         console.log(e.readyState);
    //     }, 50);
    // });

</script>

</html>